﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wicresoft.Shell.Core
{
    public class UmcType
    {
        public string TypeName;
        public List<UmcTypeProperty> Properties = new List<UmcTypeProperty>();
        public List<UmcTypeMethod> Methods = new List<UmcTypeMethod>();

        public UmcType(string aName)
        {
            TypeName = aName;
        }

        public void AddProperty(UmcTypeProperty utp)
        {
            Properties.Add(utp);
        }

        public void AddMethod(UmcTypeMethod utm)
        {
            Methods.Add(utm);
        }

    }

    public class UmcTypeProperty
    {
        public string PropertyName;
        public string TypeName;
        public string PropertyDescription;
        public UmcTypeProperty(string aName, string aTypeName, string aPropertyDescription)
        {
            PropertyName = aName;
            TypeName = aTypeName;
            PropertyDescription = aPropertyDescription;
        }
    }

    public class UmcTypeMethod
    {
        public string MethodName;
        public string MethodParam;
        public string MethodReturnTypeName;
        public string MethodDescription;
        public string[] Params;
        public UmcTypeMethod(string aName, string aParam, string aTypeName,string aMethodDescription)
        {
            MethodName = aName;
            MethodParam = aParam;
            MethodReturnTypeName = aTypeName;
            MethodDescription = aMethodDescription;

            if (aParam != "")
            {
                string[] _params = aParam.Split(',');
                int total = _params.Length;
                Params = new string[total];
                for (int i = 0; i < total; ++i)
                {
                    Params[i] = _params[i].Trim();
                }
            }
            else
            {
                Params = new string[0];
            }

        }
    }

    public class UmcVariable
    {
        public string VariableName;
        public string VariableType;
        public string VariableValue = string.Empty;

        public UmcVariable(string aName,string aTypeName)
        {
            VariableName = aName;
            VariableType = aTypeName;
        }
    }

}
